import request from "@/utils/request";
import type { MenuResponseData,MenuParams } from "./type"
export const reqGetMenuList = () =>
  request.get<any, MenuResponseData>("/admin/acl/permission");

export const reqAddOrUpdateMenu = (data:MenuParams) => {
  if(data.id){
    return request.put<any,any>("/admin/acl/permission/update",data)
  }else{
    return request.post<any,any>("/admin/acl/permission/save",data)
  }
}

export const reqDeleteMenu = (id:number) =>
  request.delete<any,any>(`/admin/acl/permission/remove/${id}`)